<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>欢迎</title>
<script type="text/javaScript">
	function test(form) {
		var login = document.getElementsByName('login');
		var j = 0;
		for (var i = 0; i < login.length; i++) {
			if (login.item(i).checked) {
				j++;
			}
		}
		if (j == 0) {
			alert("请选泽身份！");
			return false;
		}
		var uservalue = form.user.value;
		var usert = /^\w{6,10}|\d{6,10}$/;
		var passvalue = form.passw.value;
		var passt = /^\d{6,}$/;
		if (uservalue == "" || passvalue == "") {
			alert("用户名或密码不能为空！");
			document.getElementById('user').focus();
			return false;
		}
		var ut = usert.test(uservalue);
		var pt = passt.test(passvalue);
		if (!ut) {
			alert("用户名必须为字母或数字并且在6个到10个之间！");
			document.getElementById('user').focus();
			return false;
		}
		if (!pt) {
			alert("密码必须为数字并且不少于6个！");
			document.getElementById('user').focus();
			return false;
		}
		return true;
	}
</script>
<style type="text/css">
#di {
	background-color: rgba(150, 10, 160, 0.1);
	width: 300px;
	height: 150px;
	padding-top: 30px;
	border-top-right-radius: 10px;
	border-top-left-radius: 10px;
	border-bottom-left-radius: 10px;
	border-bottom-right-radius: 10px;
	width: 300px;
}

input {
	border-top-right-radius: 5px;
	border-top-left-radius: 5px;
	border-bottom-left-radius: 5px;
	border-bottom-right-radius: 5px;
}
</style>
</head>
<body background="pic/5-13050GZ015.gif"
	onload="document.getElementById('user').focus();">
	<table border="0" cellpadding="30px" cellspacing="0px" width="100%">
		<tr height="200px">
			<td colspan="2" align="center"><img
				src="pic/a3cc7cd98d1001e9c7ad571eb00e7bec54e7970a.jpg" alt="Dory"></td>
		</tr>
		<tr>
			<td align="right" width="950px"><img src="pic/wsj2015-5.png"
				alt="HalloWeen"></td>
			<td>
				<div id="di" align="center">
					<form action=f method="post" onsubmit="return test(this)">
						<p>
							用户名：<input type="text" name="user" id="user"
								style="width: 160px; height: 20px;" />
						</p>
						<p>
							密&nbsp&nbsp&nbsp&nbsp码：<input type="password" name="passw"
								style="width: 160px; height: 20px;" /><br /> <input type="radio"
								name="login" value="1">学生 <input type="radio"
								name="login" value="2">教师 <input type="radio"
								name="login" value="3">管理员
						</p>
						<input type="submit" value="登录" /> <input type="reset" value="取消"
							onclick="document.getElementById('user').focus();" />&nbsp&nbsp
						<a href="">忘记密码</a>
					</form>
				</div>
			</td>
		</tr>
	</table>
</body>
</html>